Main interface with the component system. More...
Public Member Functions | |
~MainSystem () | |
Renderer * | getRenderer () const |
bool | isInitialized () const |
bool | getHasRunToContinue () const |
void | setHasRunToContinue (bool value) |
bool | autoConfigure () |
bool | initialize () |
void | run (RenderContext *context) |
void | shutdown () |
bool | frame (RenderContext *context) |
void | tickForNewFrame (RenderContext *context) |
Main interface with the component system.
Used to initialize or shuts all of its sub parts, also used for framing or running.
nkGraphics::MainSystem::~MainSystem | ( | ) |
Destructor.
Renderer* nkGraphics::MainSystem::getRenderer | ( | ) | const |
bool nkGraphics::MainSystem::isInitialized | ( | ) | const |
bool nkGraphics::MainSystem::getHasRunToContinue | ( | ) | const |
void nkGraphics::MainSystem::setHasRunToContinue | ( | bool | value | ) |
Sets whether the run should proceed. Can be used to halt the run.
value | If the rendering should be stopped (true) or not (false). |
bool nkGraphics::MainSystem::autoConfigure | ( | ) |
Auto configures the system. By default, the system will search for a configuration file named 'GraphicConfig.cfg' in the launch path and load the configuration from it.
bool nkGraphics::MainSystem::initialize | ( | ) |
Initializes the component and all of its sub part. This implies launching the graphic system and initializing the renderer.
void nkGraphics::MainSystem::run | ( | RenderContext * | context | ) |
Runs the component. This means entering an internal running loop. This loop can be sufficient for most use cases. It ticks inputs and rendering for a given context. For more complex usage (multi windowing for instance), it is recommended to manually frame.
context | The context to run with. |
void nkGraphics::MainSystem::shutdown | ( | ) |
Shuts down the component. This frees all memory linked to it and ensure a clean leave.
bool nkGraphics::MainSystem::frame | ( | RenderContext * | context | ) |
Frames the component, once. This will update input, and render, only once.
context | The context to render for. |
void nkGraphics::MainSystem::tickForNewFrame | ( | RenderContext * | context | ) |
Ticks the engine for a new frame, without rendering. This implies setting everything up for a clean rendering for a context, and checking how async work is going. Called automatically by a frame() call.
context | The context to tick for. |